package org.ephone.utils;

import java.util.Vector;

import android.database.Cursor;
import android.provider.BaseColumns;
import android.provider.Contacts.PeopleColumns;
import android.provider.Contacts.PhonesColumns;

/*
 * A noi servono:
 * - le lettere disponibili
 * - gli id di tutti i contatti per ogni lettera dispobile
 * - servono dei cursor?
 * */

public abstract class ContactsDB {
	
	private static Cursor contacts_cursor;
	
	// Per andare a vedere quali sono le lettere disponibili
	private Vector lettersAvailable = new Vector();
	
	public static void setCursor(Cursor activity_cursor) {
		contacts_cursor = activity_cursor;
    	getContactsColumn(contacts_cursor);
	}
	
	private static void getContactsColumn(Cursor cur) {
    	if (cur.moveToFirst()) {
    		String name;
    		String phoneNumber;
    		String id;
    		int nameColumn = cur.getColumnIndex(PeopleColumns.NAME);
    		int phoneColumn = cur.getColumnIndex(PhonesColumns.NUMBER);
    		int idColumn = cur.getColumnIndex(BaseColumns._ID);
    		String imagePath;
    		
    		do {
    			name = cur.getString(nameColumn);
    			phoneNumber = cur.getString(phoneColumn);
    			//xx.setText(cur.getString(idColumn));
    		} while (cur.moveToNext());
    	}
    } 
}

